window.onload = () => {
    getRem(350, 100)
}
window.onresize = () => {
    getRem(350,100)
}

function getRem(pwidth, prem){
    let html = document.querySelector('html');
    let oWidth = document.body.clientWidth || document.documentElement.clientWidth
    html.style.fontSize = oWidth / pwidth * prem + 'px'
}